<link rel="stylesheet" href="../core/resource/components/swiper/swiper.min.css?v=3">
<style>
.swiper-container-horizontal>.swiper-pagination-bullets, .swiper-pagination-custom, .swiper-pagination-fraction{bottom:0.3rem}
.swiper-pagination-bullet {
    width: 0.2rem;
    height: 0.2rem;
    display: inline-block;
    border-radius: 0.2rem;
    background: #999;
    opacity: .2;
}
.swiper-pagination-bullet-active{background:{{main.syscolor||'#fff'}};width:0.6rem;opacity: 1;}
.swiper-container-horizontal>.swiper-pagination-bullets .swiper-pagination-bullet {
    margin: 0 0.05rem;
}
.bgbai .fui-icon-group,.bgnone .fui-icon-group {background: none}
.fui-icon-group .fui-icon-col .text {
    color: #666666;
}
.bgbai .swiper-pagination-bullet-active {
    background: #fff;
}
.bgbai .swiper-pagination-bullet {
    background: #fff;
}
.bgbai .fui-icon-group .fui-icon-col .text {
    color: #fff;
}
.coutag {padding:0.1rem 0.2rem;background:#ffedef;color:#db2e2a;font-size:0.55rem;border-radius: 0.2rem;}
</style>
<div class="swiper-container" ng-if="pagedata.tuijie.length>0">
    <div class="swiper-wrapper" style="padding-bottom:0.5rem">
      <div ng-repeat="item in pagedata.tuijie" class="swiper-slide" ng-if="pagedata.list[0].id!=item.id">
		<div style="background:#fff;border-radius:0.5rem">
		<div class="fui-list" style="align-items:flex-start;padding-bottom:0">
				<div class="fui-list-media" style="margin-right:0.3rem" href="javascript:;" ng-click="access_json('jy_paimerch/merch//id='+item.id)">
					<img class="round" style="width:2rem;height:2rem" ng-src="{{tomedia(item.logo) || '../addons/jy_merch/resource/images/nologo.png'}}">
				</div>
				<div class="fui-list-inner">
							<div href="javascript:;" ng-click="access_json('jy_paimerch/merch//id='+item.id)" class="title" style="font-size:0.76rem">
								<span class="fui-tag fui-tag-danger" style="background:linear-gradient(to right,rgba(244,221,187,0.6),rgba(235,216,174,1));color:#512f0a;width:auto;font-weight:400">推荐商户</span>
								<span class="bold"> {{item.merchname}}</span>
							</div>
							<div class="subtitle">
								<span class="coutag">销量：{{item.salenum || 0}}</span>
								<span ng-if="item.coupons.length>0" class="coutag" ng-click="access_json('jy_paimerch/merch//id='+item.id)">
								 领券:<span ng-repeat="c in item.coupons" style="padding:0.1rem;">{{c.title}}</span>
								</span>
							</div>
				</div>
		</div>
		<div ng-if="item.goods.length>0" class="fui-goods-group block" style="padding-bottom:0">
				<div ng-repeat="g in item.goods" href="javascript:;" ng-click="access_json('jy_paimerch/merch//id='+item.id+'&goodsid='+g.id)" class="fui-goods-item item" style="width:33%;border-bottom: 0 solid #e7e7e7">
										<div ng-class="{'image':1, 'echelon':item.active.title}" data-text="{{item.active.title}}" style="height:3.5rem;position:relative;background-image: url('{{tomedia(g.image) ||'../addons/jy_merch/resource/images/nologo.png'}}')">
												<div ng-show="g.total <=0" class="salez" style="background-image: url('{{tomedia(pagedata.shopset.shop.saleout)}}'); "></div>
												<div ng-if="g.video" class="playbtn"><i class="icon icon-iconfontplay2" style="font-size:1.6rem;"></i></div>
										</div>
										<div class="detail" style="padding-left:0;">
											<div class="name" style="font-size:0.6rem:color:#999">
												{{g.title}}
											</div>
											<div class="price" style="color:#fb5032;margin-top: 0;font-size:0.8rem">
												￥{{g.active.price || g.price}}
											</div>
										</div>
				</div>
		</div>
		<div ng-if="!item.goods || item.goods.length<1" class='content-empty' style="margin-top:0">
				<i class='icon icon-cart1' style="font-size:2rem"></i>
				<div style="padding-bottom:0.5rem">该商户没有任何商品！</div>
		</div>
		</div>
	</div>
</div>
<div class="swiper-pagination"></div>
</div>
<script type="text/javascript">
scope.pagedata.gettuijie=function(item){
	var lat_lng=scope.pagedata.lat_lng;
	scope.get('jy_paimerch/index/getmerchs/order=istuijie&limit=6&lat='+lat_lng.lat+'&lng='+lat_lng.lng,function(res){
		scope.pagedata.tuijie=res.list
		scope.$evalAsync();
		require(['swiper'], function (Swiper) {
				var swiper = new Swiper('.swiper-container', {
					pagination: {
						el: '.swiper-pagination',
					},
				});
		});
	});
}
if(!scope.pagedata.lat_lng){
	// 百度地图API功能
	window.scope.location(function(re){
		scope.pagedata.lat_lng=re.lat_lng;
		var lat_lng=scope.pagedata.lat_lng;
		var lat_lng = re.lat_lng;
		scope.pagedata.params.lat=lat_lng.lat;
		scope.pagedata.params.lng=lat_lng.lng;	
		scope.tool.get_list('jy_paimerch/index/getmerchs/',true,function(res){
				scope.pagedata.showtypemerchs=res.list
		});
		scope.pagedata.gettuijie();
	});
}else{
	scope.pagedata.gettuijie();
}
</script>